-
Notifications
You must be signed in to change notification settings - Fork 17
Convert the scripts to Dart #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert the scripts to Dart #56
Conversation
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
johnpryan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I wonder if we could make the --help flag more useful though.
scripts/bin/update_local.dart
Outdated
| await runScript((context) async { | ||
| final parser = ArgParser(); | ||
| parser.addFlag( | ||
| 'help', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this doesn't have super useful output when I use the help flag for UpdateLocalCommand:
Usage: update_local
-h, --help Print this usage information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a good point. The reason it's like that is that I used to have some other args and removed them. I still think it's helpful to know that there are no other options, but maybe until there are other options I should just remove the arg parsing altogether. The code would be a lot simpler.
Description
Converts the scripts to be Dart scripts instead, so they can be more cross platform and more maintainable by the Flutter team (no more powershell, for instance).
Also adds tests for the scripts.
Fixes #45
Summary of Changes
This pull request undertakes a significant refactoring effort by migrating the project's build, versioning, and local update scripts from various shell languages to Dart. The primary goal is to enhance the scripts' cross-platform compatibility and ease of maintenance for the Flutter team. This change involves the removal of old shell scripts and the introduction of new, well-structured Dart equivalents, complete with a dedicated utility layer and unit tests to ensure reliability.
Highlights
build_release.dartfor creating release archives,bump_version.dartfor updating project versions, andupdate_local.dartfor managing local installations.utils.dartfile provides shared functionalities and aScriptContextfor dependency injection, significantly enhancing the testability of the scripts. Unit tests for the new Dart scripts have also been added.Changelog
gemini-extension.jsonandCHANGELOG.md.gemini-extension.jsonandCHANGELOG.md.ScriptContextfor dependency injection,ExitExceptionfor controlled exits, and helper functions for finding the repository root, getting platform info, and running/capturing process output.BuildReleaseCommand,BumpVersionCommand, andUpdateLocalCommandusing mock file systems and process managers.